import type { FormRules } from 'element-plus'
type FormItemType = 'input' | 'select' | 'password'

export interface IForm {
  rules?: FormRules
  labelWidth?: string | number
  formItems: IFormItem[],
  btns?: IBtn[]
}

export interface IFormItem {
  type: FormItemType
  field: string
  label?: string
  prop?: string
  required?: boolean
  span?: number
  // 对于select类型
  options?: IOption[]
  // 其他属性
  otherOptions?: any
}

export interface IOption {
  label: string
  value: any
}

export interface IBtn {
  name: string
  action: string
  needValid: boolean
  otherOptions?: any
}


export interface IMsg {
  action: string
  data?: any
}
